﻿@using Microsoft.AspNetCore.Identity
@inject SignInManager<IdentityUser> SignInManager
@inject UserManager<IdentityUser> UserManager


<!-- Header Account Links Start -->
    <div class="header-account-links">

        @if (SignInManager.IsSignedIn(User))
        {
            <a id="manage" asp-area="Identity" asp-page="/Account/Manage/Index"><span>@UserManager.GetUserName(User).Split('@').FirstOrDefault()</span></a>            
            <form id="logoutForm" class="form-inline" asp-area="Identity" asp-page="/Account/Logout" asp-route-returnUrl="@Url.Page("/Index", new { area = "" })">
                <button id="logout" type="submit" class="nav-link btn btn-small btn-link">Logout</button>                
            </form>
        }
        else
        {
            <a id="register" asp-area="Identity" asp-page="/Account/Register"><i class="icofont icofont-user-alt-7"></i> <span>Register</span></a>
            <a id="login" asp-area="Identity" asp-page="/Account/Login"><i class="icofont icofont-login d-none"></i> <span>Login</span></a>
        }

    </div>
<!-- Header Account Links End -->



@*<ul class="navbar-nav">
    @if (SignInManager.IsSignedIn(User))
    {
        <li class="nav-item">
            <a id="manage" class="nav-link text-dark" asp-area="Identity" asp-page="/Account/Manage/Index" title="Manage">Hello @UserManager.GetUserName(User)!</a>
        </li>
        <li class="nav-item">
            <form id="logoutForm" class="form-inline" asp-area="Identity" asp-page="/Account/Logout" asp-route-returnUrl="@Url.Page("/Index", new { area = "" })">
                <button id="logout" type="submit" class="nav-link btn btn-link text-dark">Logout</button>
            </form>
        </li>
    }
    else
    {
        <li class="nav-item">
            <a class="nav-link text-dark" id="register" asp-area="Identity" asp-page="/Account/Register">Register</a>
        </li>
        <li class="nav-item">
            <a class="nav-link text-dark" id="login" asp-area="Identity" asp-page="/Account/Login">Login</a>
        </li>
    }
</ul>*@
